import request from '@/utils/request'

// 查询邮件列表列表
export function listEmailList(query) {
  return request({
    url: '/system/EmailList/list',
    method: 'get',
    params: query
  })
}

// 查询邮件列表详细
export function getEmailList(emailId) {
  return request({
    url: '/system/EmailList/' + emailId,
    method: 'get'
  })
}

// 新增邮件列表
export function addEmailList(data) {
  return request({
    url: '/system/EmailList',
    method: 'post',
    data: data
  })
}

// 邮件失败重发
export function reSend(data) {
  return request({
    url: '/system/EmailList/reSend',
    method: 'post',
    data: data
  })
}

// 修改邮件列表
export function updateEmailList(data) {
  return request({
    url: '/system/EmailList',
    method: 'put',
    data: data
  })
}

// 删除邮件列表
export function delEmailList(emailId) {
  return request({
    url: '/system/EmailList/' + emailId,
    method: 'delete'
  })
}


// 重发
export function reSendListAll() {
  return request({
    url: '/system/EmailQueue/reSendAll',
    method: 'get'
  })
}

// 全部删除
export function deleteAllEmail(type) {
  return request({
    url: '/system/EmailList/removeAll/' + type,
    method: 'delete'
  })
}